// function handleClick(e) {

// const handleClick = function(e) {
//   console.log(e)
//   e.target.style.color = 'red'
//   const circleElem = document.getElementById('circleId')
//   // console.log(circleElem);
//   // circleElem.style.display = 'block'
//   if (circleElem.classList.contains('circle-show')) {
//     circleElem.className = 'circle'
//   } else {
//     circleElem.classList.add('circle-show')
//   }
// }

const getUserInfo = function(e){
    console.log('getUserInfo',e);
    axios.get('http://127.0.0.1:3000/user').then((res) =>{
        console.log(res.data);
        document.getElementById('name').innerText = res.data.name;
        document.getElementById('age').innerText = res.data.age + "岁";
        document.getElementById('avatar').src = 'data:image/png;base64,' + res.data.avatar;
        document.getElementById('sex').innerText = res.data.sex;
        document.getElementById('tel').innerText = res.data.tel;
        document.getElementById('email').innerText = res.data.email;
        document.getElementById('location').innerText = res.data.location;
        // document.getElementById('locationlink').innerText = res.data.locationlink;
    })
    .catch((err) => { console.error(err) })
  }
  
  const buttonElem = document.getElementById('button')
  // console.log("this is button\n")
  buttonElem.addEventListener('click', getUserInfo)
  
  // buttonElem.addEventListener('dblclick', handleClick)
  